home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Games / PC-SIG World of Games (CDRM1080710) (1993).iso / 262 / ATALLY.ASC < prev    next >
Text File  |  1985-12-26  |  18KB  |  354 lines

  1. 10000 '*************************************************************
  2. 10002 '*****    PC-GOLF    THE GOLFER's PROGRAM     PC-GOLF    *****
  3. 10004 '*****    Version 1.5  (C) 1982,1983,1984 Ed Chandler    *****
  4. 10006 '*************************************************************
  5. 10018 '    2. TALLY THE SCORES FOR A ROUND
  6. 10020 '+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  7. 10030 MNU5$="PC-GOLF's Scorekeeper"
  8. 10040 CLS:PRINT MNU2$:PRINT:PRINT MNU5$:PRINT
  9. 10042 IF ROS=0 THEN 10060
  10. 10050 DEF SEG=&H40:I%=PEEK(&H17):I%=I% OR 32:POKE &H17,I% 'num lock on
  11. 10060 IF PACT>0 THEN 10100
  12. 10070 PRINT:PRINT"The player roster is empty.  To Tally"
  13. 10080 PRINT"scores you must first add a player"
  14. 10090 PRINT"to the player roster.":GOSUB 580:GOTO 530 'back to main
  15. 10100 MNU1$="1. Tally the player's scores only.":PRINT SPC(3);MNU1$
  16. 10110 MNU3$="2. Tally the player's putts only.":PRINT SPC(3);MNU3$
  17. 10120 MNU4$="3. Tally both the player's putts and scores.":PRINT SPC(3);MNU4$
  18. 10130 PRINT SPC(3);MNURT$:PRINT
  19. 10140 M1$="key":M2$="(1,2,3 or M) ":GOSUB 570
  20. 10150 IF KB=1 THEN MNU6$=MNU1$:YT=1:GOTO 10200
  21. 10160 IF KB=2 THEN MNU6$=MNU3$:YT=2:GOTO 10200
  22. 10170 IF KB=3 THEN MNU6$=MNU4$:YT=3:GOTO 10200
  23. 10180 IF KB$="M" OR KB$="m" THEN CLOSE:GOTO 530 'back to main
  24. 10190 GOSUB 610:GOTO 10040 'menu
  25. 10200 CLS:PRINT MNU5$:X=1:GOSUB 550 'show roster
  26. 10210 PRINT:IF PR=0 THEN GOSUB 590:GOTO 530 'back to main
  27. 10220 LINE INPUT"ENTER the line number of the player you want to tally. ";KB$
  28. 10230 KB=VAL(KB$):IF KB>0 AND KB<=PMAX AND TMP(KB)=KB THEN 10260
  29. 10240 GOSUB 611:GOTO 10200
  30. 10250 '+++++
  31. 10260 PRN=KB:GOSUB 660:GET #4,KB 'get players record
  32. 10270 RN=VAL(E4$):N$=MID$(GCDIR$(RN),3,NMAX):IF INSTR(N$,"*")=0 THEN 10320
  33. 10280 PRINT:PRINT"The player has not been assigned a home course. You must"
  34. 10290 PRINT"assign a home course before scores can be tallied."
  35. 10300 CLOSE #4:GOSUB 580:GOTO 530 'back to main
  36. 10310 '+++++
  37. 10320 HC=1:T$="White":IF G4$="g" THEN T$="Gold"
  38. 10330 IF G4$="b" THEN T$="Blue" ELSE IF G4$="r" THEN T$="Red"
  39. 10340 GOSUB 670:GET #5,KB 'get player.dat
  40. 10350 CLS:PRINT MNU5$:PRINT:PRINT MNU6$:PRINT
  41. 10360 COLOR 0,15,0:PRINT SPC(7);B4$:COLOR 7,0,0
  42. 10370 PRINT:PRINT "Do you want to TALLY scores for:"
  43. 10380 '
  44. 10390 PRINT"a round played at,"
  45. 10400 PRINT:COLOR 0,15,0:PRINT SPC(7);N$:COLOR 7,0,0
  46. 10410 PRINT:PRINT"using the ";:COLOR 0,15,0:PRINT SPC(2)T$SPC(2);
  47. 10420 COLOR 7,0,0:PRINT" tees?"
  48. 10430 RESTORE 834:GOSUB 600:IF KB$="Y" THEN 10700 ' ok-go
  49. 10440 '+++++     get preferred course     +++++
  50. 10450 CLS:PRINT MNU5$:M1=0:GOSUB 540 'show courses
  51. 10460 PRINT:PRINT"PRESS the line number of the course"
  52. 10470 PRINT:M1$="where this round was played. ":GOSUB 560
  53. 10480 IF KB>0 AND KB<=CMAX AND TMP(KB)=KB THEN 10510
  54. 10490 PRINT:PRINT"Please choose a line number from the list."
  55. 10500 GOSUB 580:GOTO 10450
  56. 10510 HC=1:RN=KB:IF RN=VAL(E4$) THEN 10550
  57. 10520 HC=0:PRINT:PRINT"This is not the player's home course.":BEEP
  58. 10530 RN=KB:RESTORE 813:GOSUB 600
  59. 10540 IF KB$<>"Y" THEN 10450
  60. 10550 GOSUB 650:GOSUB 655:GET #2,RN:GET #3,RN:CLOSE #2,#3 'get course records
  61. 10560 P$=E2$:IF F4$="f" THEN P$=H2$
  62. 10570 GOSUB 710 'set up CP(I)=course pars
  63. 10580 CLS:PRINT:PRINT MNU5$:PRINT:T=1
  64. 10590 IF CVS(K2$)<>0 THEN PRINT USING" #. GOLD"; T:T$(T)="Gold":A$(T)=K2$:T=T+1
  65. 10600 IF CVS(L2$)<>0 THEN PRINT USING" #. BLUE"; T:T$(T)="Blue":A$(T)=L2$:T=T+1
  66. 10610 IF CVS(F2$)<>0 THEN PRINT USING" #. WHITE";T:T$(T)="White":A$(T)=F2$:T=T+1
  67. 10620 IF CVS(I2$)<>0 THEN PRINT USING" #. RED";  T:T$(T)="Red" :A$(T)=I2$:T=T+1
  68. 10630 PRINT:PRINT"PRESS the line number for the Tees"
  69. 10640 M1$="the player used for this round. ":GOSUB 560
  70. 10650 T=T-1:IF KB<1 OR KB>T THEN GOSUB 610:GOTO 10580
  71. 10660 T$=T$(KB) 'cr name
  72. 10670 CR!=CVS(A$(KB)) 'CR for this course
  73. 10680 N$=MID$(GCDIR$(RN),3,NMAX):GOTO 10350
  74. 10690 '+++++ get course records
  75. 10700 GOSUB 650:GOSUB 655:GET #2,RN:GET #3,RN:CLOSE #2,#3
  76. 10710 P$=E2$:IF F4$="f" THEN P$=H2$
  77. 10720 GOSUB 710 'set CP(I)=pars
  78. 10730 IF YT=1 OR YT=3 THEN 10810 'tally scores
  79. 10740 '+++++
  80. 10750 IF YT=2 OR YT=3 THEN 12250 'tally putts
  81. 10760 'nop
  82. 10770 '+++++     SAVE SCORES AND PUTTS     +++++
  83. 10780 PUT #5,PRN:CLOSE #5:PUT #4,PRN:CLOSE #4 'player.dat & pdir.dat
  84. 10790 GOTO 10040 'menu
  85. 10800 '+++++     TALLY SCORES     +++++
  86. 10810 CLS:PRINT MNU6$:PRINT:PRINT"ENTER the front side scores for ";B4$
  87. 10820 PRINT:PRINT SPC(6);"Hole #  Score"
  88. 10830 S=3:N=1:M=9:L=0:GOSUB 720 'get scores in ps(m)
  89. 10840 PRINT:PRINT SPC(4);"Score is ";SUM
  90. 10850 RESTORE 833:GOSUB 600 'ask for change
  91. 10860 T$="Change a front nine score"
  92. 10870 IF KB$="Y" THEN M1$="Score":GOSUB 740:GOTO 10850 'make change
  93. 10880 CLS:PRINT MNU6$:PRINT:PRINT"ENTER the back side scores for ";B4$
  94. 10890 PRINT:PRINT SPC(6);"Hole #  Score"
  95. 10900 S=3:N=1:M=9:L=9:GOSUB 720 'get scores in ps(m)
  96. 10910 PRINT:PRINT SPC(5);"Score is ";SUM
  97. 10920 RESTORE 833:GOSUB 600 'ask for change
  98. 10930 T$="Change a back nine score"
  99. 10940 IF KB$="Y" THEN M1$="Score":GOSUB 740:GOTO 10920 'make change
  100. 10950 '++++++    get adjusted gross score    +++++
  101. 10960 GOSUB 650:GOSUB 655:GET #2,RN:GET #3,RN:CLOSE #2,#3 'gcdir.dat,course.dat
  102. 10970 IF F4$="m" THEN FOR I=1 TO 18:TMP(I)=VAL(MID$(E2$,I,1)):NEXT' get pars
  103. 10980 IF F4$="f" THEN FOR I=1 TO 18:TMP(I)=VAL(MID$(H2$,I,1)):NEXT' get pars
  104. 10990 T$=LEFT$(C5$,1):H=VAL(LEFT$(C5$,2))
  105. 11000 IF T$="+" THEN H=-H 'H'cap
  106. 11010 GOSUB 13210 '+++++     calculate adjusted gross score     +++++
  107. 11020 '+++++     DISPLAY SCORES     +++++
  108. 11030 CLS:PRINT SPC(15):COLOR 0,15,0:PRINT" ADJUSTED GROSS SCORES ";:COLOR 7,0,0
  109. 11040 PRINT SPC(18);GREG$:PRINT
  110. 11050 PRINT "HOLE #";SPC(4);
  111. 11060 FOR I=1 TO 9 STEP 3:PRINT USING "###";I;I+1;I+2;:PRINT SPC(1):NEXT I
  112. 11070 PRINT "Front";
  113. 11080 FOR I=10 TO 18 STEP 3:PRINT USING "###";I;I+1;I+2;:PRINT SPC(1):NEXT I
  114. 11090 PRINT "Back":PRINT SPC(41);"nine";SPC(30);"nine":PRINT "PAR";SPC(8);
  115. 11100 FOR I=1 TO 9 STEP 3:PRINT CP(I);CP(I+1);CP(I+2);SPC(1):NEXT I:PRINT CF;
  116. 11110 FOR I=10 TO 18 STEP 3:PRINT USING "###";CP(I);CP(I+1);CP(I+2);
  117. 11120 PRINT SPC(1):NEXT I:PRINT CB
  118. 11130 PRINT "gross score";
  119. 11140 FOR I=1 TO 9 STEP 3:PRINT PS(I);PS(I+1);PS(I+2);SPC(1);:NEXT I:PRINT PF;
  120. 11150 FOR I=10 TO 18 STEP 3:PRINT USING "###";PS(I);PS(I+1);PS(I+2);
  121. 11160 PRINT SPC(1):NEXT I:PRINT PB
  122. 11170 PRINT:COLOR 0,15,0:PRINT " adj.gross ";
  123. 11180 FOR I=1 TO 9 STEP 3:PRINT GS(I);GS(I+1);GS(I+2);SPC(1);:NEXT I:PRINT AF;
  124. 11190 FOR I=10 TO 18 STEP 3:PRINT USING "###";GS(I);GS(I+1);GS(I+2);
  125. 11200 PRINT SPC(1);:NEXT I:PRINT AB:COLOR 7,0,0
  126. 11210 '+++++  arrow adjusted scores
  127. 11220 T$="adjustments ":N$=CHR$(42)+SPACE$(2):FOR I=1 TO 18
  128. 11230 TMP(I)=1:IF GS(I)=PS(I) THEN TMP(I)=0
  129. 11240 IF TMP(I)=1 THEN T$=T$+N$ ELSE T$=T$+SPACE$(3)
  130. 11250 IF FNNMODM(I,3)=0 THEN T$=T$+SPACE$(1)
  131. 11260 IF I=9 THEN T$=T$+SPACE$(5)
  132. 11270 NEXT I:PRINT T$:PRINT
  133. 11280 '+++++
  134. 11290 PRINT "PAR is ";PAR;" at ";B2$
  135. 11300 PRINT "The player's score is ";:PRINT USING "###";PS
  136. 11310 LOCATE CSRLIN+1,15:COLOR 0,15,0:PRINT" The adjusted score is ";
  137. 11320 PRINT USING "###";HS;:PRINT" "
  138. 11330 LOCATE CSRLIN,15:PRINT "  based on handicap of  ";C5$
  139. 11340 KB$=B4$:GOSUB 700 'remove excess spaces
  140. 11350 LOCATE CSRLIN,15:PRINT" The tally is completed for ";KB$+" ":COLOR 7,0,0
  141. 11360 GOSUB 590
  142. 11370 '+++++
  143. 11380 '
  144. 11390 CLS:PRINT MNU6$:PRINT
  145. 11400 PRINT"For PC-GOLF'S calculations you have two options."
  146. 11410 PRINT:PRINT " Option one."
  147. 11420 PRINT"   1. Include the adjusted gross score in the handicap calculation."
  148. 11430 PRINT"   2. Do not use this score. This was a practice round.":PRINT
  149. 11440 M1$="number":M2$="(1 or 2) ":GOSUB 570
  150. 11450 RESTORE 814
  151. 11460 IF KB=1 THEN GOSUB 600:IF KB$="Y" THEN 11500 ELSE CLS: GOTO 11390
  152. 11470 IF KB=2 THEN GOSUB 600:IF KB$="Y" THEN 11890 ELSE CLS:GOTO 11390
  153. 11480 PRINT:PRINT"Please choose an option number. ":GOSUB 580:CLS:GOTO 11390
  154. 11490 '+++++     get course rating     +++++
  155. 11500 CR!=CVS(F2$):IF G4$="r" THEN CR!=CVS(I2$)
  156. 11510 IF G4$="g" THEN CR!=CVS(K2$) ELSE IF G4$="b" THEN CR!=CVS(L2$)
  157. 11520 '
  158. 11530 '+++++     save the last 20 differentials     +++++
  159. 11540 N=1:FOR I=1 TO 19:TMP(I+1)=CVI(MID$(D5$,N,2)):N=N+2:NEXT
  160. 11550 TMP(1)=10*HS-INT(10*CR!)
  161. 11560 P$="":FOR I=1 TO 20:P$=P$+MKI$(TMP(I)):NEXT
  162. 11570 LSET D5$=P$:LSET A5$="V" ' adj.scores valid data
  163. 11580 '
  164. 11590  '+++++     calculate new h'cap-sort for low scores     +++++
  165. 11600  FOR I=1 TO 19:K=I+1:FOR J=K TO 20
  166. 11610  IF TMP(I)<=TMP(J) THEN 11630
  167. 11620  T=TMP(I):TMP(I)=TMP(J):TMP(J)=T
  168. 11630  NEXT J:NEXT I
  169. 11640 K=CVI(O5$)+1:IF K>20 THEN K=20 'count diffs
  170. 11650 RSET O5$=MKI$(K)
  171. 11660 '
  172. 11670 N=10:IF K=20 THEN 11740 'get # differentials to use
  173. 11680 IF K<=5 THEN N=1
  174. 11690 IF K=6 THEN N=2 ELSE IF K=7 THEN N=3
  175. 11700 IF K>7 AND K<20 THEN N=INT(K/2)
  176. 11710 '
  177. 11720 '+++++ get new h'cap
  178. 11730 '+++++
  179. 11740 T!=0:S=20-K+1:F=S+N-1 'set bounds on diffs
  180. 11750 FOR I=S TO F:T!=T!+TMP(I):NEXT 'get low diff's
  181. 11760 HT$=" ":IF K<20 THEN HT$="T"
  182. 11770 X=N*10:T!=P96!*T!:T=CINT(T!/X) ' convert and round
  183. 11780 T$=STR$(T):T$=MID$(T$,2,2)+HT$
  184. 11790 IF T!<0 THEN T$="+"+RIGHT$(T$,2)
  185. 11800 RSET C5$=T$:RSET D4$=C5$
  186. 11810 GOTO 11880 '+++++     debug
  187. 11820 PRINT "adj gross=";HS,"cr=";CR!
  188. 11830 PRINT:PRINT"# diffs=";K;" # used=";N;"Hcap=";T$
  189. 11840 T!=0:PRINT"low diffs=";:FOR I=S TO F:PRINT TMP(I);:T!=T!+TMP(I):NEXT:PRINT
  190. 11850 PRINT"sum of diffs=";T!
  191. 11860 PRINT USING"HCAP= ##.###";T!/N;:PRINT SPC(1)C5$;
  192. 11870 STOP
  193. 11880 '+++++
  194. 11890 IF HC=1 THEN 11950 'tra if home course
  195. 11900 PRINT:PRINT"Option two"
  196. 11910 PRINT"The gross scores from this round will not be included in the"
  197. 11920 PRINT"player's data bank since the course is not the players home course.
  198. 11930 BEEP:GOSUB 590:GOTO 12230
  199. 11940 '+++++
  200. 11950 PRINT:PRINT" Option two."
  201. 11960 PRINT"   1.  Include the gross scores in the players data bank."
  202. 11970 PRINT"   2.  Do not use these scores. This was a practice round.":PRINT
  203. 11980 M1$="number":M2$="(1 or 2) ":GOSUB 570
  204. 11990 RESTORE 814
  205. 12000 IF KB=1 THEN GOSUB 600:IF KB$="Y" THEN 12060 ELSE CLS:GOTO 11950
  206. 12010 IF KB=2 THEN GOSUB 600:IF KB$="Y" THEN 12230 ELSE CLS:GOTO 11950
  207. 12020 PRINT:PRINT"Please choose an option number. ":GOSUB 580:CLS:GOTO 11950
  208. 12030 '+++++
  209. 12040 '
  210. 12050 '+++++     count the round     +++++
  211. 12060 E5=CVI(E5$)+1:RSET E5$=MKI$(E5) 'total rounds tallied
  212. 12070 '+++++     save the last 20 actual scores     +++++
  213. 12080 N=3:FOR I=2 TO 20:TMP(I)=CVI(MID$(F5$,N,2)):N=N+2:NEXT
  214. 12090 P$="":FOR I=2 TO 20:P$=P$+MKI$(TMP(I)):NEXT:P$=P$+MKI$(PS)
  215. 12100 LSET F5$=P$:LSET A5$="V" 'last 20 actuals
  216. 12110 '+++++     sum the actuals for each hole     +++++
  217. 12120 N=1:FOR I=1 TO 18:TX(I)=CVI(MID$(G5$,N,2)):N=N+2
  218. 12130 TX(I)=TX(I)+PS(I):NEXT 'sum actuals for each hole
  219. 12140 P$="":FOR I=1 TO 18:P$=P$+MKI$(TX(I)):NEXT
  220. 12150 LSET G5$=P$ 'actuals for each hole
  221. 12160 '+++++     lowest actual score for each hole     +++++
  222. 12170 FOR I=1 TO 18:DIF(I)=VAL(MID$(H5$,I,1))
  223. 12180 IF PS(I)<DIF(I) THEN DIF(I)=PS(I) 'get low score
  224. 12190 NEXT:P$="":FOR I=1 TO 18:P$=P$+RIGHT$(STR$(DIF(I)),1):NEXT
  225. 12200 LSET H5$=P$ 'low actual each hole
  226. 12210 '+++++     low actual round     +++++
  227. 12220 T=CVI(I5$):IF PS<T THEN T=PS:RSET I5$=MKI$(T)
  228. 12230 GOTO 10750 'SCORES DONE
  229. 12240 '+++++     TALLY PUTTS     +++++
  230. 12250 IF YT=3 THEN FOR I=1 TO 18:IJ(I)=PS(I):NEXT I:AF=PF:AB=PB 'save gross #'s
  231. 12260 CLS:PRINT MNU6$:PRINT:PRINT"ENTER the front side putts for ";B4$
  232. 12270 PRINT:PRINT SPC(6);"Hole #  Score"
  233. 12280 S=4:N=1:M=9:L=0:GOSUB 720 'get scores in ps(m)
  234. 12290 PRINT:PRINT SPC(4);"Score is ";SUM
  235. 12300 RESTORE 833:GOSUB 600 'ask for change
  236. 12310 T$="Change a front nine score"
  237. 12320 IF KB$="Y" THEN M1$="Score":GOSUB 740:SUM=X:GOTO 12300 'make change
  238. 12330 PF=SUM
  239. 12340 CLS:PRINT MNU6$:PRINT:PRINT"ENTER the back side putts for ";B4$
  240. 12350 PRINT:PRINT SPC(6);"Hole #  Score"
  241. 12360 S=4:N=1:M=9:L=9:GOSUB 720 'get scores in ps(m)
  242. 12370 PRINT:PRINT SPC(5);"Score is ";SUM
  243. 12380 RESTORE 833:GOSUB 600 'ask for change
  244. 12390 T$="Change a back nine score"
  245. 12400 IF KB$="Y" THEN M1$="Score":GOSUB 740:SUM=X:GOTO 12380 'make change
  246. 12410 PB=SUM:PS=PF+PB 'gross putts
  247. 12420 '+++++
  248. 12430 IF HC<>1 THEN 12630
  249. 12440 '+++++     count the round     +++++
  250. 12450 J5=CVI(J5$)+1:RSET J5$=MKI$(J5) 'total rounds tallied
  251. 12460 '+++++     save the last 20 actual scores     +++++
  252. 12470 N=3:FOR I=2 TO 20:TMP(I)=CVI(MID$(K5$,N,2)):N=N+2:NEXT
  253. 12480 P$="":FOR I=2 TO 20:P$=P$+MKI$(TMP(I)):NEXT:P$=P$+MKI$(PS)
  254. 12490 LSET K5$=P$:LSET A5$="V" 'last 20 actuals
  255. 12500 '+++++     sum the actuals for each hole     +++++
  256. 12510 N=1:FOR I=1 TO 18:GS(I)=CVI(MID$(L5$,N,2)):N=N+2
  257. 12520 GS(I)=GS(I)+PS(I):NEXT 'sum actuals for each hole
  258. 12530 P$="":FOR I=1 TO 18:P$=P$+MKI$(GS(I)):NEXT
  259. 12540 LSET L5$=P$ 'actuals for each hole
  260. 12550 '+++++     lowest actual score for each hole     +++++
  261. 12560 FOR I=1 TO 18:DIF(I)=VAL(MID$(M5$,I,1))
  262. 12570 IF PS(I)<DIF(I) THEN DIF(I)=PS(I) 'get low score
  263. 12580 NEXT:P$="":FOR I=1 TO 18:P$=P$+RIGHT$(STR$(DIF(I)),1):NEXT
  264. 12590 LSET M5$=P$ 'low actual each hole
  265. 12600 '+++++     low actual round     +++++
  266. 12610 T=CVI(N5$):IF PS<T THEN T=PS:RSET N5$=MKI$(T)
  267. 12620 '+++++     DISPLAY PUTTS     +++++
  268. 12630 CLS:PRINT SPC(18):COLOR 0,15,0:PRINT" PUTTING SCORES ";:COLOR 7,0,0
  269. 12640 PRINT SPC(22);GREG$:PRINT
  270. 12650 CF=0:CB=0:FOR I=1 TO 9:CF=CF+CP(I):CB=CB+CP(I+9):NEXT I
  271. 12660 PRINT "HOLE #";SPC(4);
  272. 12670 FOR I=1 TO 9 STEP 3:PRINT USING "###";I;I+1;I+2;:PRINT SPC(1):NEXT I
  273. 12680 PRINT "Front";
  274. 12690 FOR I=10 TO 18 STEP 3:PRINT USING "###";I;I+1;I+2;:PRINT SPC(1):NEXT I
  275. 12700 PRINT "Back":PRINT SPC(41);"nine";SPC(30);"nine":PRINT "PAR";SPC(8);
  276. 12710 FOR I=1 TO 9 STEP 3:PRINT CP(I);CP(I+1);CP(I+2);SPC(1):NEXT I:PRINT CF;
  277. 12720 FOR I=10 TO 18 STEP 3:PRINT USING "###";CP(I);CP(I+1);CP(I+2);
  278. 12730 PRINT SPC(1):NEXT I:PRINT CB
  279. 12740 IF YT=2 THEN 12780 ELSE PRINT "gross score";
  280. 12750 FOR I=1 TO 9 STEP 3:PRINT IJ(I);IJ(I+1);IJ(I+2);SPC(1);:NEXT I:PRINT AF;
  281. 12760 FOR I=10 TO 18 STEP 3:PRINT USING "###";IJ(I);IJ(I+1);IJ(I+2);
  282. 12770 PRINT SPC(1):NEXT I:PRINT AB
  283. 12780 PRINT:COLOR 0,15,0:PRINT " putts     ";
  284. 12790 FOR I=1 TO 9 STEP 3:PRINT PS(I);PS(I+1);PS(I+2);SPC(1);:NEXT I:PRINT PF;
  285. 12800 FOR I=10 TO 18 STEP 3:PRINT USING "###";PS(I);PS(I+1);PS(I+2);
  286. 12810 PRINT SPC(1);:NEXT I:PRINT PB:COLOR 7,0,0
  287. 12820 '+++++  delta strokes & putts
  288. 12830 IF YT=2 THEN 12920
  289. 12840 S=0:FOR I=1 TO 9:DIF(I)=IJ(I)-PS(I):S=S+DIF(I):NEXT I
  290. 12850 T=0:FOR I=10 TO 18:DIF(I)=IJ(I)-PS(I):T=T+DIF(I):NEXT I
  291. 12860 PRINT"strokes    ";:FOR I=1 TO 18:PRINT DIF(I);
  292. 12870 IF FNNMODM(I,3)=0 THEN PRINT SPC(1)
  293. 12880 IF I=9 THEN PRINT S;SPC(1);
  294. 12890 IF I=18 THEN PRINT USING"##";T
  295. 12900 NEXT I
  296. 12910 '+++++
  297. 12920 PRINT:PRINT "PAR is ";PAR;" at ";B2$
  298. 12930 IF YT=3 THEN PRINT "The player's score is ";:PRINT USING "###";AF+AB
  299. 12940 LOCATE CSRLIN+1,15:COLOR 0,15,0:PRINT" The putting score is  ";
  300. 12950 PRINT USING "### ";PS
  301. 12960 IF YT=3 THEN LOCATE CSRLIN,15:PRINT "  the stroke score is  ";S+T
  302. 12970 KB$=B4$:GOSUB 700 'remove excess spaces
  303. 12980 LOCATE CSRLIN,15:PRINT" The tally is completed for ";KB$+" ":COLOR 7,0,0
  304. 12990 GOSUB 590:IF HC=1 THEN 13040
  305. 13000 PRINT:PRINT:BEEP
  306. 13010 PRINT"The putting scores for this round will not be included in the
  307. 13020 PRINT"player's data bank since the course is not the players home course.
  308. 13030 GOSUB 590
  309. 13040 GOTO 10760 'PUTTS DONE
  310. 13050 '+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  311. 13060 '     CALCULATE USGA ADJUSTED SCORE
  312. 13070 'ENTER CP(I)=par scores for the course
  313. 13080 '      PS(I)=players scores for the course
  314. 13090 '      H=players present USGA handicap(0-40)
  315. 13100 'RETURN HS=players adjusted score - USGA rules
  316. 13110 '       PS=players actual score
  317. 13120 '       M=limit of strokes over par on the number of
  318. 13130 '       holes equal to handicap OR equal to excess
  319. 13140 '       of handicap over 18 or 36.
  320. 13150 '       N=M-1 limit of strokes over par on balance of holes
  321. 13160 '       B=# of holes where M over par is allowed
  322. 13170 '       C=# of holes where M over par was made or C=B
  323. 13180 '       Q=C-B  where Q>=0
  324. 13190 'NOTE: Scratch players.  Limit one over par on any hole
  325. 13200 '+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  326. 13210 PAR=0:CF=0:CB=0:Q=0:HS=0:C=0:PS=0:PF=0:PB=0:AF=0:AB=0 'init
  327. 13220 B=H:   M=1:N=1:IF H<=0 THEN 13260 'scratch player
  328. 13230        M=2:N=1:IF H<19 THEN 13260 'handicap < 19
  329. 13240 B=H-18:M=3:N=2:IF H<37 THEN 13260 'handicap < 37
  330. 13250 B=H-36:M=4:N=3                    'handicap < 41
  331. 13260 FOR I=1 TO 18:DIF(I)=PS(I)-CP(I):PAR=PAR+CP(I):PS=PS+PS(I)
  332. 13270 IF DIF(I)>=M THEN C=C+1 '# of holes where M over par was made
  333. 13280 IF DIF(I) <M THEN HS=HS+DIF(I) 'total strokes under limit
  334. 13290 NEXT I
  335. 13300 IF C>B THEN Q=C-B 'excess # of holes where M over par was made
  336. 13310 IF C>B THEN C=B 'set limit on # holes at M over par
  337. 13320 HS=HS + M*C + PAR + N*Q 'adjusted score USGA rules
  338. 13330 ZZ= M*B + PAR + N*(18-B) 'max allowed over par score
  339. 13340 T1=0
  340. 13350 FOR I=1 TO 18 'get adj. scores for each hole
  341. 13360 IF DIF(I)>=M AND T1<=B THEN GS(I)=CP(I)+M:T1=T1+1 'max over par this hole
  342. 13370 IF DIF(I)>=M AND T1>B THEN GS(I)=CP(I)+N  'max score for this hole
  343. 13380 IF DIF(I)<M THEN GS(I)=PS(I) 'use players actual score
  344. 13390 IF I<10 THEN PF=PF+PS(I) ELSE PB=PB+PS(I) 'get front/back totals
  345. 13400 IF I<10 THEN CF=CF+CP(I) ELSE CB=CB+CP(I)
  346. 13410 IF I<10 THEN AF=AF+GS(I) ELSE AB=AB+GS(I)
  347. 13420 NEXT I
  348. 13430 RETURN
  349. 14000 '+++++     grunt work
  350. 14010 DELETE 490-9999
  351. 14020 SAVE"b:tally.asc",A
  352. 14030 RUN"b:main.bas"
  353. 15000 'for chain delete
  354. 14000 '+++++     grunt work